package 适配器模式.快排和二分查找;

public class Client {
    public static void main(String[] args) {
        int[] arr={1,30,25,78,50};//数组
        int target=25;//查找目标值
        QuickSort quickSort = new QuickSort();//快排
        BinarySearch binarySearch = new BinarySearch();//二分查找

        //创建适配器类
        DataOperation dataOperation = new DataOperationImpl(quickSort, binarySearch);


        System.out.println("遍历排序后结果");
        for (int i : dataOperation.sort(arr)) {
            System.out.print(i+"\t");
        }
        System.out.println("二分查找结果");
        System.out.println(dataOperation.search(arr, 25));

    }

}
